/*
 * Created on Jun 23, 2004
 */
package org.vectrics.recruiter.user;

import java.util.Date;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.SimpleTrigger;
import org.quartz.Trigger;
import org.vectrics.SystemException;
import org.vectrics.batch.VectricsQuartzScheduler;
import org.vectrics.hibernate.ApplicationContext;
import org.vectrics.provider.CoreServiceLocator;


/**
 * This class will instantiate the scheduler for running job agents.
 *
 * @author mmoore
 */
public class JobAgentScheduler extends VectricsQuartzScheduler {
	private transient final Log log = LogFactory.getLog(JobAgentScheduler.class);

	/**
	 * Constructor
	 */
	public JobAgentScheduler(ApplicationContext applicationContext) {
		super(applicationContext);
	}

	public String getJobName() {
		return("Job Agent Batch Job");
	}

	public int getSecondsUntilStart() {
		Long seconds = CoreServiceLocator.getSystemService().getLongSystemConstantGlobal("job.agent.batch.startup.seconds");
		return(seconds.intValue());
	}
	
	public long getSecondsInterval() {
		Long interval = CoreServiceLocator.getSystemService().getLongSystemConstantGlobal("job.agent.batch.interval");
		return(interval.longValue());
	}
	
	public Class getJobClass() {
		return(InvokeJobAgentsQuartzJob.class);
	}
	
}
